{% extends "news/base.html" %}

{% block titleBlock %}
    文章详情页
{% endblock %}
{% block scriptBlock %}
    <script type="text/javascript" src="../../static/news/js/detail.js"></script>
{% endblock %}
{% block categoryBlock %}
{% endblock %}

{% block contentBlock %}
    <div class="detail_con fl">
    <h3>{{ data.news.title }}</h3>
    <div class="detail_about clearfix">
        <span class="time_souce fl">{{ data.news.create_time }} 来源: {{ data.news.source }}</span>
        <span class="comment fr">{{ data.news.comments_count }}</span>
    </div>
    {{ data.news.content | safe }}
    {#        <h3>恒指创收盘历史新高 沪指创逾2个月来新高 房地产板块集体爆发</h3>#}
    {#        <div class="detail_about clearfix">#}
    {#            <span class="time_souce fl">2018-01-16 14:38 来源: 商务部</span>#}
    {#            <span class="comment fr">3</span>#}
    {#        </div>#}
    {##}
    {#        <p class="summary">#}
    {#            摘要：昨天终结十一连阳之后，今天A股迅速重拾涨势，沪指收涨0.8%创逾两个月新高。房地产板块集体走强，尾盘更是放量大涨，万科A一度逼近涨停，最终收涨8.4%，股价创历史新高。#}
    {#        </p>#}
    {##}
    {#        <h4>恒指创收盘历史新高</h4>#}
    {##}
    {#        <p>#}
    {#            港股方面今天表现强劲，开年以来的上涨势头仍然延续，恒指收涨1.8%创下收盘新高。此前恒指的峰值是在2007年10月份盘中触及的31958点。</p>#}
    {#        <p>#}
    {#            今天恒指51支成份股中，42支上涨，7支下跌，对恒指贡献最大的个股包括建设银行上涨3.7%，腾讯控股上涨2.5%，香港交易所上涨5.9%，工商银行上涨3.3%，中国平安上涨2.8%。</p>#}
    {#        <p>#}
    {#            2018年的前15日，恒生指数已经上涨了4.75%，恒生国企指数上涨了6.50%。</p>#}
    {#        <p>#}
    {#            兴业证券张忆东在最新报告中表示，港股作为全球估值洼地，不论是分红率高的价值股还是业绩确定的成长股都受益于新一年中资和海外机构资金的重新布局。他维持2016年以来对“港股牛市”的判断，认为2018年港股市场会出现核心资产驱动的慢牛、长牛行情。他还预计今年下半年港股将迎来牛市主升浪。</p>#}
    {#        <p>#}
    {#            与A股交相呼应，港股内房股今天也是集体爆发的行情。万科企业涨9.2%，融创中国涨3.7%，碧桂园涨3%，中国恒大涨1.6%。</p>#}
    {#        <p>#}
    {#            此外，中国平安港股股价再创历史新高，盘中一度触及91.00港元。中国平安在A股市场今天也一度上涨近2%，离历史高点仅一步之遥，但收盘时回落，最终收涨0.2%。</p>#}
    {#        <p>#}
    {#            昨天晚间，中国平安公布2017年保费收入，全年该集团控股子公司平安财险、平安人寿、平安养老、平安健康原保险合同保费收入分别为2159.84亿元、3689.34亿元、175.6亿元及21.47亿元，合计约6046.26亿元人民币，同比增28.9%。除此以外，市场传出中国平安旗下的陆金所将于4月分拆于香港上市，估值达600亿美元。</p>#}


    {#        <a href="javascript:;" class="collection block-center">收藏</a>#}
    {#        <a href="javascript:;" class="collected block-center" style="display: none"><span class="out">已收藏</span><span#}
    {#                class="over">取消收藏</span></a>#}
    <a href="javascript:;" class="collected block-center" data-newid="{{ data.news.id }}"
       style="display: {% if data.is_collected %} block
       {% else %} none {% endif %};"><span class="out">已收藏</span><span class="over">取消收藏</span></a>
    <a href="javascript:;" class="collection block-center" data-newid="{{ data.news.id }}"
       style="display: {% if data.is_collected %} none
       {% else %} block {% endif %};">收藏</a>

    {#        <div class="comment_form_logout">#}
    {#            登录发表你的评论#}
    {#        </div>#}
    {##}
    {#        <form action="" class="comment_form">#}
    {#            <div class="person_pic">#}
    {#                <img src="../../static/news/images/cat.jpg" alt="用户图标">#}
    {#            </div>#}
    {% if data.user %}
        <form action="" class="comment_form" data-newsid="{{ data.news.id }}">
            <div class="person_pic">
                <img src="{% if data.user.avatar_url %}
                        {{ data.user.avatar_url }}
                    {% else %}
                        ../../static/news/images/person01.png
                    {% endif %}" alt="用户图标">
            </div>
            <textarea placeholder="请发表您的评论" class="comment_input"></textarea>
            <input type="submit" name="" value="评 论" class="comment_sub">
        </form>
    {% else %}
        <div class="comment_form_logout">
            登录发表你的评论
        </div>

        {#        <textarea placeholder="请发表您的评论" class="comment_input"></textarea>#}
        {#        <input type="submit" name="" value="评 论" class="comment_sub">#}
        {#        </form>#}
    {% endif %}

    <div class="comment_count">
        {{ data.news.comments_count }}条评论
    </div>

    <div class="comment_list_con">
        <div class="comment_list">
            {% for comment in data.comments %}
            <div class="comment_list">
                <div class="person_pic fl"><img src="{% if comment.user.avatar_url %}
                           {{ comment.user.avatar_url }}
                        {% else %}
                            ../../static/news/images/person01.png
                        {% endif %}" alt="用户图标">
                </div>
                <div class="user_name fl">{{ comment.user.nick_name }}</div>
                <div class="comment_text fl">{{ comment.content }}</div>
                {% if comment.parent %}
                    <div class="reply_text_con fl">
                        <div class="user_name2">{{ comment.parent.user.nick_name }}</div>
                        <div class="reply_text">
                            {{ comment.parent.content }}
                        </div>
                    </div>
                {% endif %}
                <div class="comment_time fl">{{ comment.create_time }}</div>
{#                <a href="javascript:;" class="comment_up {% if comment.is_like %}has_comment_up{% endif %} fr" data-commentid="{{ comment.id }}"#}
{#                   data-newsid="{{ comment.news_id }}">赞</a>#}
                    <a href="javascript:;" class="comment_up
                        {% if comment.is_like %}
                            has_comment_up
                        {% endif %} fr"
                           data-commentid="{{ comment.id }}"
                           data-likecount="{{ comment.like_count }}"
                           data-newsid="{{ data.news.id }}">
                        {% if comment.like_count > 0 %}
                            {{ comment.like_count }}
                        {% else %}
                            赞
                    {% endif %}</a>
                <a href="javascript:;" class="comment_reply fr">回复</a>
                <form class="reply_form fl" data-commentid="{{ comment.id }}" data-newsid="{{ data.news.id }}">
                    <textarea class="reply_input"></textarea>
                    <input type="button" value="回复" class="reply_sub fr">
                    <input type="reset" name="" value="取消" class="reply_cancel fr">
                </form>
            </div>
        {% endfor %}
        </div>
    </div>


    </div>
{% endblock %}

{% block authorBlock %}
{#    <div class="author_card">#}
{#        <a href="#" class="author_pic"><img src="../../static/news/images/user_pic.png" alt="author_pic"></a>#}
{#        <a href="#" class="author_name">刘强东</a>#}
{#        <div class="author_resume">刘强东的简介,刘强东</div>#}
{#        <div class="writings"><span>总篇数</span><b>23</b></div>#}
{#        <div class="follows"><span>粉丝</span><b>36</b></div>#}
{#        <a href="javascript:;" class="focus fr">关注</a>#}
{#        <a href="javascript:;" class="focused fr"><span class="out">已关注</span><span class="over">取消关注</span></a>#}
{#    </div>#}
    {% if data.news.author %}
        <div class="author_card">
            <a href="#" class="author_pic"><img src="{% if data.news.author.avatar_url %}
            {{ data.news.author.avatar_url }}
            {% else %}
            ../../static/news/images/user_pic.png
            {% endif %}" alt="author_pic"></a>
            <a href="#" class="author_name">{{ data.news.author.nick_name }}</a>
            <div class="author_resume">签名：{{ data.news.author.signature }}</div>
            <div class="writings"><span>总篇数</span><b>{{ data.news.author.news_count }}</b></div>
            <div class="follows"><span>粉丝</span><b>{{ data.news.author.followers_count }}</b></div>
            <a href="javascript:;" class="focus fr" data-userid="{{ data.news.author.id }}" style="display: {% if data.is_followed %}none{% else %}block{% endif %}">关注</a>
            <a href="javascript:;" class="focused fr" data-userid="{{ data.news.author.id }}" style="display: {% if data.is_followed %}block{% else %}none{% endif %}"><span class="out">已关注</span><span class="over">取消关注</span></a>
{#            <a href="javascript:;" class="focus fr" data-userid="{{ data.news.author.id }}">关注</a>#}
{#            <a href="javascript:;" class="focused fr" data-userid="{{ data.news.author.id }}"><span class="out">已关注</span><span class="over">取消关注</span></a>#}
        </div>
    {% endif %}
{% endblock %}
